package com.jiangdong.craft.entity;

import java.io.Serializable;

/**
 * t_relation
 * @author 
 */
public class Relation implements Serializable {

    private Integer id;

    /*
    * 节点id
    * */
    private Integer procedureId;

    /**
     * 此节点指向的节点id
     */
    private Integer prepositionId;

    /**
     * 指向该节点的节点id
     */
    private Integer postpostitionId;

    /**
     * 所属流程图id
     */
    private Integer craftId;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getProcedureId() {
        return procedureId;
    }

    public void setProcedureId(Integer procedureId) {
        this.procedureId = procedureId;
    }

    public Integer getPrepositionId() {
        return prepositionId;
    }

    public void setPrepositionId(Integer prepositionId) {
        this.prepositionId = prepositionId;
    }

    public Integer getPostpostitionId() {
        return postpostitionId;
    }

    public void setPostpostitionId(Integer postpostitionId) {
        this.postpostitionId = postpostitionId;
    }

    public Integer getCraftId() {
        return craftId;
    }

    public void setCraftId(Integer craftId) {
        this.craftId = craftId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Relation other = (Relation) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getProcedureId() == null ? other.getProcedureId() == null : this.getProcedureId().equals(other.getProcedureId()))
            && (this.getPrepositionId() == null ? other.getPrepositionId() == null : this.getPrepositionId().equals(other.getPrepositionId()))
            && (this.getPostpostitionId() == null ? other.getPostpostitionId() == null : this.getPostpostitionId().equals(other.getPostpostitionId()))
            && (this.getCraftId() == null ? other.getCraftId() == null : this.getCraftId().equals(other.getCraftId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProcedureId() == null) ? 0 : getProcedureId().hashCode());
        result = prime * result + ((getPrepositionId() == null) ? 0 : getPrepositionId().hashCode());
        result = prime * result + ((getPostpostitionId() == null) ? 0 : getPostpostitionId().hashCode());
        result = prime * result + ((getCraftId() == null) ? 0 : getCraftId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", procedureId=").append(procedureId);
        sb.append(", prepositionId=").append(prepositionId);
        sb.append(", postpostitionId=").append(postpostitionId);
        sb.append(", craftId=").append(craftId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}